package com.ymanage.test;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.ymanage.dao.FinanceIncomeMapper;
import com.ymanage.dao.UserMapper;
import com.ymanage.entity.User;
import com.ymanage.util.UUIDUtil;

public class Demo {

	
	public void test(){
		String str = "100000000000";
		System.out.println(str.length());
	}
	
	
	public void test2(){
		
		ApplicationContext context = new ClassPathXmlApplicationContext("spring/spring.xml");
		
		UserMapper userMapper = (UserMapper) context.getBean("userMapper");
		User user = userMapper.getUser(1);
		System.out.println(user.getUname());
		
	}
	
	@Test
	public void test3() throws ParseException{
		
		ApplicationContext context = new ClassPathXmlApplicationContext("spring/spring.xml");
		
		FinanceIncomeMapper f = (FinanceIncomeMapper) context.getBean("financeIncomeMapper");
		
		Date date = new SimpleDateFormat("yyyy-MM-dd").parse("2017-08-07");
		
		System.out.println(f.getYearMoney());
		
	}
	
	@Test
	public void test4() throws Exception{
		
		System.out.println(UUIDUtil.getUUID());
		
	}
	
	
	
	
	
}
